package com.robb19y.rgbdscanner.viewer;

import java.util.ArrayList;

import org.OpenNI.GeneralException;

import com.robb19y.rgbdscanner.core.RGBDData;
import com.robb19y.rgbdscanner.core.RGBDFilter;
import com.robb19y.rgbdscanner.core.RGBDSensor;

public class Streamer {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		try {
			RGBDSensor camera = new RGBDSensor();
			camera.setTimeout(300);
			JVRep vrep = new JVRep();
			vrep.startSimulation();
			camera.start();
			Thread.sleep(1000);
			RGBDFilter filter = new RGBDFilter();
			filter.setPixelStep(4);
			
			
			RGBDData[][] data = camera.getRgbdData();
			ArrayList<RGBDData> list;
			while(true){
				data = camera.getRgbdData();
				list = filter.filter(data);				
				vrep.addPointCloud(list);
			}
			
			
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		
		
	}

}
